<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="<%=path %>sys/css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="<%=path%>sys/easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="<%=path%>sys/easyui/themes/icon.css">
        <link rel="stylesheet" type="text/css" href="<%=path%>sys/easyui/demo/demo.css">
        <script type="text/javascript" src="<%=path%>sys/easyui/jquery.min.js"></script>
        <script type="text/javascript" src="<%=path%>sys/easyui/jquery.easyui.min.js"></script>
        <script src="<%=path%>sys/js/uploadPreview.js"></script>
    </head>
    <style type="text/css">
        html{
            height:100%
        }

        body{
            height:100%;
            background:url(images/myToto.jpg) top center no-repeat; background-size:cover;
        }
        .news h3,.news_three h3{margin:0;width: 100%;height: 30px;line-height: 30px;font-weight: normal;font-size:14px;text-indent: 10px;background:#0e92df;}
        .input-prepend{font-size:14px;}
        .charts h3 a,.news h3 a{float: right;margin-right: 10px;color: #fff;text-decoration: none;font-size: 14px;}
        .news h3{
            border-bottom: #ccc 1px solid;
            padding-bottom: 1px;
            background:#0F7474 !important;
            font-size:14px;
            font-family:"Microsoft YAHEI";
            color:#fff;
        }
        
    </style>
    <body>
        <div class="content" style="height:100%;">
            <div class=""></div>
            
            <div class="news" id="c1_1" style="height: auto;border:1px solid #fee;float:left;width:99%;margin:10px auto 15px;">
                <div id="tb" style="padding:2px 5px;margin:10px 0;">
                    <div class="input-prepend">
                        <span class="add-on" style="color: #333">开始时间</span>
                        <input id="beginTime" class="easyui-datebox" style="width: 100px;height:30px" data-options="editable:false">
                    </div>
                    <div class="input-prepend">
                         <span class="add-on" style="color: #333">结束时间</span>
                        <input id="endTime" class="easyui-datebox" style="width: 100px;height:30px" data-options="editable:false">
                    </div>
                    <button type="button" class="btn btn-info" id="search">查询</button>
                </div>
            </div>
            <!--操作面板 结束 -->
            <!--数据表格-->
            <div style="width:99%;margin:0 auto;height:88%">
                <table id="limitGrid" style="width:100%;height:100%"></table>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        $(function(){
            initTable();
        }) 
        
        function init(){
            $("#approvalStatus").combobox({
				 //url:'<%=path%>normalplan/getParamByParamCode.action?paramCode=approvalStatus',
				 valueField: 'value',
			     textField: 'label',
			     value:"-1",
	             data: [{
	                        label: '全部',
	                        value: '-1'
	                    },{
	                        label: '使用',
	                        value: '1'
	                    },{
	                        label: '禁用',
	                        value: '2'
	                    }],
				 editable:false
			});
        }
        
    function initTable(){
		$("#limitGrid").datagrid({
			//url:'limitPlan/query.action',
			method:'post',
			width:'100%',
			rownumbers:true,
			singleSelect:true,
			fitColumns:true,
			pagination:true,
			onLoadSuccess:function(data){
			},
			columns:[[{field:'id',title:'唯一表示',width:0,align:'center'},
                      {field:'name',title:'留言人姓名',width:80,align:'center'},
				      {field:'email',title:'邮箱',width:120,align:'center'},
				      {field:'tel',title:'电话',width:120,align:'center'},
				      {field:'CreateTime',title:'留言时间',width:70,align:'center'},
				      {field:'note',title:'内容',width:160,align:'center'}
				    ]],
			toolbar:[
                  {text:"删除",iconCls:"icon-remove",handler:function(){
                    var row = $('#limitGrid').datagrid('getSelected');
                    if(row==null) return $.messager.alert("提示信息", "当前没有选中记录！");
       	            $.messager.confirm('提示信息','确定删除吗?', function (r) {
       					if (r) {
       	                        $.messager.alert("提示信息", "删除成功");
       	                    }
       	                });
                  }}
			], 
            data: [
                {id:'1',name:'sala', email:'ppp@163.com',tel:'15188332212',CreateTime:'2016-11-5 21:40:38',note:'略...'},
                {id:'2',name:'jorn', email:'ppp@163.com',tel:'15188332212',CreateTime:'2016-11-5 21:40:38',note:'略...'},
                {id:'3',name:'Mr5', email:'ppp@163.com',tel:'15188332212',CreateTime:'2016-11-5 21:40:38',note:'略...'},
                {id:'4',name:'liu li', email:'ppp@163.com',tel:'15188332212',CreateTime:'2016-11-5 21:40:38',note:'略...'}
            ]
		});
	   
	   var p = $('#limitGrid').datagrid('getPager'); 
          $(p).pagination({ 
              pageSize: 10,//每页显示的记录条数，默认为10
              pageList:[5,10,15,20],//每页显示几条记录
              beforePageText: '第',//页数文本框前显示的汉字
              afterPageText: '页    共 {pages} 页',
              displayMsg: '当前显示 {from} - {to} 条记录    共 {total} 条记录',
              onBeforeRefresh:function(){ 
                  $(this).pagination('loading');//正在加载数据中...
                  $(this).pagination('loaded'); //数据加载完毕
              } 
          }); 
        $("#limitGrid").datagrid("hideColumn", "id");
	}
        
    function formatOper(val,row){
        var str = '<center>';
        
        if('0'==val){
            str += '使用：<input type=\"radio\" checked=\"checked\" name=\"flag'+row.id+'\" value=\"0\" />&nbsp;';
            str += '禁用：<input type=\"radio\" name=\"flag'+row.id+'\" value=\"1\" />';
            
        }else{
            str += '使用：<input type=\"radio\" name=\"flag'+row.id+'\" value=\"0\" />&nbsp;';
            str += '禁用：<input type=\"radio\" checked=\"checked\" name=\"flag'+row.id+'\" value=\"1\" />';
            
        }
		return str+'</center>';
    }
    </script>
</html>
